home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir43 / med300.zip / MEDELETE.CLA < prev    next >
Text File  |  1994-02-22  |  3KB  |  77 lines

  1.  
  2. !▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  3. !█                                     █
  4. !█ MEDELETE.CLA                                                          █
  5. !█ Text deletion                             █
  6. !█                                     █
  7. !█ Revision Number: 1                             █
  8. !█ Revision Date  : 22-Feb-94                                            █
  9. !█                                     █
  10. !█ Revision History                             █
  11. !█   1 Created                                 █
  12. !█                                     █
  13. !▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  14.  
  15.              MEMBER('MEMOEDIT')
  16.  
  17. !═════════════════════════════════════════════════════════════════════════
  18. !              Delete character at cursor
  19. !═════════════════════════════════════════════════════════════════════════
  20. ME_DelChar   PROCEDURE
  21.  
  22.          ! Locals:
  23. ubChar       BYTE                                ! Character
  24.  
  25.   CODE
  26.   ubChar = ME_GetChar(MED:usPosition)            ! Get last character
  27.   ME_DelTxt(MED:usPosition, 1)                   ! Delete character
  28.   IF ubChar = eHRt                               ! If hard return deleted
  29.     ME_ReformDoc()                               !   Reformat document
  30.   ELSE                         ! Else
  31.     ME_ReformPar(MED:usPosition)                 !   Reformat paragrpah
  32.   .                         ! Endif
  33.   RETURN
  34.  
  35.  
  36. !═════════════════════════════════════════════════════════════════════════
  37. !        Delete from current position to to end of line
  38. !═════════════════════════════════════════════════════════════════════════
  39. ME_DelEOL    PROCEDURE
  40.  
  41.          ! Locals:
  42. isNChars     SHORT                 ! # of chars to delete
  43. ubChar       BYTE                                ! Last character
  44.  
  45.   CODE
  46.   isNChars = (MED:usLineEnd - MED:usPosition) + 1! Calc # of chars to delete
  47.   ubChar = ME_GetChar(MED:usLineEnd)             ! Get last character
  48.   IF ubChar = eHRt                               ! If hard return
  49.     isNChars -= 1                 !   Adjust # chars to delete
  50.   .                         ! Endif
  51.   ME_DelTxt(MED:usPosition, isNChars)            ! Delete to EOL
  52.   ME_ReformPar(MED:usPosition)                   ! Reformat paragrpah
  53.   RETURN
  54.  
  55.  
  56. !═════════════════════════════════════════════════════════════════════════
  57. !              Delete entire current line
  58. !═════════════════════════════════════════════════════════════════════════
  59. ME_DelLine   PROCEDURE
  60.  
  61.          ! Locals:
  62. isNChars     SHORT                 ! # of chars to delete
  63. ubChar       BYTE                                ! Last character
  64.  
  65.   CODE
  66.   isNChars = (MED:usLineEnd - MED:usLineStart) + 1 ! Calc # of chars to delete
  67.   MED:usPosition = MED:usLineStart               ! Move to BOL
  68.   IF MED:usPosition > 0                          ! Insert hard return
  69.     ubChar = ME_GetChar(MED:usPosition-1)        !
  70.     IF ubChar <> eHRt                            !
  71.       ME_InsTxt(MED:usPosition-1, 1, CHR(eHRt))  !
  72.   . .                         !
  73.   ME_DelTxt(MED:usPosition, isNChars)            ! Delete text
  74.   ME_ReformDoc()                                 ! Reformat document
  75.   RETURN
  76.  
  77.